#include "getapplicationresultfromserver.h"


GetApplicationResultFromServer::GetApplicationResultFromServer(const Id& id)
{
    m_messageType = MessageType::GetFriendApplicationResult;
    m_id = id;
}

GetApplicationResultFromServer::GetApplicationResultFromServer(const QJsonObject& jsonObj)
{
    m_messageType = static_cast<MessageType>(jsonObj[JsonKey::TYPE].toInt());
    m_id = jsonObj[JsonKey::ID].toInt();
}

QJsonObject GetApplicationResultFromServer::PackJsonData() const
{
    QJsonObject jsonObj;
    jsonObj[JsonKey::TYPE] = static_cast<int>(m_messageType);
    jsonObj[JsonKey::ID] = m_id;
    return jsonObj;
}

Id GetApplicationResultFromServer::getId() const
{
    return m_id;
}
